package com.yisu.expressway.ewf.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;

public class OrderMain implements Serializable {

    private Long orderId;

    private String userAccount;

    private String userName;

    private Integer payType;

    private String payOrderId;

    private Integer orderStatus;

    private BigDecimal orderAmount;

    private BigDecimal goodsAllAmount;

    private BigDecimal discountAmount;

    private String orderAbstract;

    private String consigneeAccount;

    private String consigneeName;

    private String consigneeProvince;

    private String consigneeCity;

    private String consigneeArea;

    private String consigneeAddress;

    private String consigneeIdNumber;

    private Integer tradeType;

    private String logisticsNo;

    private String logisticsName;

    private String logisticsOrderId;

    private Timestamp createTime;

    private Timestamp cancelTime;

    private static final long serialVersionUID = 1L;

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public String getPayOrderId() {
        return payOrderId;
    }

    public void setPayOrderId(String payOrderId) {
        this.payOrderId = payOrderId;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public BigDecimal getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(BigDecimal orderAmount) {
        this.orderAmount = orderAmount;
    }

    public BigDecimal getGoodsAllAmount() {
        return goodsAllAmount;
    }

    public void setGoodsAllAmount(BigDecimal goodsAllAmount) {
        this.goodsAllAmount = goodsAllAmount;
    }

    public BigDecimal getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(BigDecimal discountAmount) {
        this.discountAmount = discountAmount;
    }

    public String getOrderAbstract() {
        return orderAbstract;
    }

    public void setOrderAbstract(String orderAbstract) {
        this.orderAbstract = orderAbstract;
    }

    public String getConsigneeAccount() {
        return consigneeAccount;
    }

    public void setConsigneeAccount(String consigneeAccount) {
        this.consigneeAccount = consigneeAccount;
    }

    public String getConsigneeName() {
        return consigneeName;
    }

    public void setConsigneeName(String consigneeName) {
        this.consigneeName = consigneeName;
    }

    public String getConsigneeProvince() {
        return consigneeProvince;
    }

    public void setConsigneeProvince(String consigneeProvince) {
        this.consigneeProvince = consigneeProvince;
    }

    public String getConsigneeCity() {
        return consigneeCity;
    }

    public void setConsigneeCity(String consigneeCity) {
        this.consigneeCity = consigneeCity;
    }

    public String getConsigneeArea() {
        return consigneeArea;
    }

    public void setConsigneeArea(String consigneeArea) {
        this.consigneeArea = consigneeArea;
    }

    public String getConsigneeAddress() {
        return consigneeAddress;
    }

    public void setConsigneeAddress(String consigneeAddress) {
        this.consigneeAddress = consigneeAddress;
    }

    public String getConsigneeIdNumber() {
        return consigneeIdNumber;
    }

    public void setConsigneeIdNumber(String consigneeIdNumber) {
        this.consigneeIdNumber = consigneeIdNumber;
    }

    public Integer getTradeType() {
        return tradeType;
    }

    public void setTradeType(Integer tradeType) {
        this.tradeType = tradeType;
    }

    public String getLogisticsNo() {
        return logisticsNo;
    }

    public void setLogisticsNo(String logisticsNo) {
        this.logisticsNo = logisticsNo;
    }

    public String getLogisticsName() {
        return logisticsName;
    }

    public void setLogisticsName(String logisticsName) {
        this.logisticsName = logisticsName;
    }

    public String getLogisticsOrderId() {
        return logisticsOrderId;
    }

    public void setLogisticsOrderId(String logisticsOrderId) {
        this.logisticsOrderId = logisticsOrderId;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getCancelTime() {
        return cancelTime;
    }

    public void setCancelTime(Timestamp cancelTime) {
        this.cancelTime = cancelTime;
    }

    public enum TradeTypeEnum {
        WAIT_DELIVER_GOODS(1,"进口商品"),
        WAIT_RECEIVE_GOODS(0,"非进口");
        public int code;
        public String name;
        TradeTypeEnum(int code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getEnumNameByCode(int code) {
            for (TradeTypeEnum item : TradeTypeEnum.values()) {
                if (item.code == code)
                    return item.name;
            }
            return null;
        }

        public static TradeTypeEnum getTypeByCode(int code) {
            for (TradeTypeEnum item : TradeTypeEnum.values()) {
                if (item.code == code)
                    return item;
            }
            return null;
        }
    }

    public enum OrderStatus {
        CANCEL_ORDER(-100,"取消订单"),
        CANCEL_WAIT_PAY(-10,"等待退款"),
        WAIT_PAY(0,"等待付款"),
        WAIT_DELIVER_GOODS(10,"等待发货"),
        WAIT_RECEIVE_GOODS(20,"等待收货"),
        SUCCESS(100,"交易成功");
        public int code;
        public String name;
        OrderStatus(int code, String name) {
            this.code = code;
            this.name = name;
        }

       public static String getEnumNameByCode(int code) {
            for (OrderStatus item : OrderStatus.values()) {
                if (item.code == code)
                    return item.name;
            }
            return null;
        }

        public static OrderStatus getTypeByCode(int code) {
            for (OrderStatus item : OrderStatus.values()) {
                if (item.code == code)
                    return item;
            }
            return null;
        }
    }

    public enum PayType {
        PAY_ON_DELIVER(0,"货到付款"),//货到付款
        PAY_WECHAT(1,"微信"),
        PAY_ALIPAY(2,"支付宝");
        public int code;
        public String name;
        PayType(int code, String name) {
            this.code = code;
            this.name = name;
        }

        public static String getEnumNameByCode(int code) {
            for (PayType item : PayType.values()) {
                if (item.code == code)
                    return item.name;
            }
            return null;
        }
    }
}